import { Component, OnInit } from '@angular/core';
import { MomentMoodService } from './services/moment-mood.service';
import { GlobalMoodService } from './services/global-mood.service';
@Component({
  selector: 'app-mode',
  templateUrl: './mood.component.html',
  styleUrls: ['./mood.component.less'],
  providers: [ MomentMoodService ],
})
export class MoodComponent implements OnInit {

  moodArr: string[] = ['心花怒放', '蛋蛋的忧伤', '郁闷', '满满的正能量'];

  constructor(private momentMoodService: MomentMoodService, private globalMoodService: GlobalMoodService) { }

  onClickToGetMomentMood() {
    const i = Math.floor(Math.random() * 4);
    this.momentMoodService.mood = this.moodArr[i];
  }
  onClickToGetGlobalMood() {
    const i = Math.floor(Math.random() * 4);
    this.globalMoodService.mood = this.moodArr[i];
  }
  ngOnInit() {
  }

}
